<?php	
	include "curl.php";
	if(isset($_POST['user_id'])){
		$name = $_POST['user_id'];
		$password = $_POST['password'];			
		
		$token = getToken($name,$password);
		$tenants = getTenants($token);
		
		echo json_encode(array('token'=>$token,'tenants'=>$tenants),JSON_FORCE_OBJECT);
	}
	if(isset($_POST['tenants_Name'])){		
		$token = $_POST['token'];
		$tenants = getTenants($token);		
		$tenantToken = getTenantstoken($_POST['tenants_Name'],$_POST['token']);
		//print_r($tenants);
		$compute_limits = getCompute_limits($_POST['tenants_Id'],$tenantToken);
		$blockstorage_limits = getBlockstorage_limits($_POST['tenants_Id'],$tenantToken);
		
		echo json_encode(array('compute_limits'=>$compute_limits,'blockstorage_limits'=>$blockstorage_limits));
	}	
		
?>
